from flask import Flask, abort
app = Flask(__name__)

@app.route('/test/<int:value>')
def test(value):
    if value < 0:
        abort(400)  # 终止请求并返回400 Bad Request错误
    return f"异常值：{value}"

if __name__ == '__main__':
    app.run()

